package com.n9.qq.android.login;

import com.qq.taf.jce.JceInputStream;
import com.qq.taf.jce.JceOutputStream;
import com.qq.taf.jce.JceStruct;

/**
 * @author ice
 * @since 2019/2/18 15:24
 */
public class SvcReqRegister extends JceStruct {
    public byte bIsOnline = 0;
    public byte bIsShowOnline = 0;
    public byte bKikPC = 0;
    public byte bKikWeak = 0;
    public byte bOnlinePush = 0;
    public byte bRegType = 0;
    public byte bSlientPush = 0;
    public byte cConnType = 0;
    public byte cNetType = 0;
    public int iLocaleID = 2052;
    public long iOSVersion = 0x10L;
    /**
     * iStatus = 0X0B 在线登陆  iStatus = 0x29 隐身登陆
     */
    public int iStatus = 11;
    public long lBid = 7L;
    public long lUin = 0L;
    public String sBuildVer = "";
    public String sOther = "";
    public String strDevName = "";
    public String strDevType = "";
    public String strOSVer = "";
    public long timeStamp = 0L;
    public byte[] vecDevParam = null;
    public byte[] vecGuid = null;

    public SvcReqRegister() {
    }

    /**
     * @param qqUin             qq号
     * @param imeiMd5           imeimd5
     * @param strDevName        设备名称
     * @param strDevType        设备类型
     * @param strOSVer          系统版本
     */
    public SvcReqRegister(long qqUin, byte[] imeiMd5, String strDevName, String strDevType, String strOSVer) {
        this.lUin = qqUin;
        this.vecGuid = imeiMd5;
        this.strDevName = strDevName;
        this.strDevType = strDevType;
        this.strOSVer = strOSVer;
    }

    @Override
    public void readFrom(JceInputStream var1) {
        this.lUin = var1.read(this.lUin, 0, true);
        this.lBid = var1.read(this.lBid, 1, true);
        this.cConnType = var1.read(this.cConnType, 2, true);
        this.sOther = var1.readString(3, true);
        this.iStatus = var1.read(this.iStatus, 4, false);
        this.bOnlinePush = var1.read(this.bOnlinePush, 5, false);
        this.bIsOnline = var1.read(this.bIsOnline, 6, false);
        this.bIsShowOnline = var1.read(this.bIsShowOnline, 7, false);
        this.bKikPC = var1.read(this.bKikPC, 8, false);
        this.bKikWeak = var1.read(this.bKikWeak, 9, false);
        this.timeStamp = var1.read(this.timeStamp, 10, false);
        this.iOSVersion = var1.read(this.iOSVersion, 11, false);
        this.cNetType = var1.read(this.cNetType, 12, false);
        this.sBuildVer = var1.readString(13, false);
        this.bRegType = var1.read(this.bRegType, 14, false);
        this.vecDevParam = var1.read(vecDevParam, 15, false);
        this.vecGuid = var1.read(vecGuid, 16, false);
        this.iLocaleID = var1.read(this.iLocaleID, 17, false);
        this.bSlientPush = var1.read(this.bSlientPush, 18, false);
        this.strDevName = var1.readString(19, false);
        this.strDevType = var1.readString(20, false);
        this.strOSVer = var1.readString(21, false);
    }

    @Override
    public void writeTo(JceOutputStream var1) {
        var1.write(this.lUin, 0);
        var1.write(this.lBid, 1);
        var1.write(this.cConnType, 2);
        var1.write(this.sOther, 3);
        var1.write(this.iStatus, 4);
        var1.write(this.bOnlinePush, 5);
        var1.write(this.bIsOnline, 6);
        var1.write(this.bIsShowOnline, 7);
        var1.write(this.bKikPC, 8);
        var1.write(this.bKikWeak, 9);
        var1.write(this.timeStamp, 10);
        var1.write(this.iOSVersion, 11);
        var1.write(this.cNetType, 12);
        if (this.sBuildVer != null) {
            var1.write(this.sBuildVer, 13);
        }

        var1.write(this.bRegType, 14);
        if (this.vecDevParam != null) {
            var1.write(this.vecDevParam, 15);
        }

        if (this.vecGuid != null) {
            var1.write(this.vecGuid, 16);
        }

        var1.write(this.iLocaleID, 17);
        var1.write(this.bSlientPush, 18);
        if (this.strDevName != null) {
            var1.write(this.strDevName, 19);
        }

        if (this.strDevType != null) {
            var1.write(this.strDevType, 20);
        }

        if (this.strOSVer != null) {
            var1.write(this.strOSVer, 21);
        }

    }
}
